﻿namespace Codeblack.TfsScrumboard.Runtime
{
    using Microsoft.Practices.Unity;

    /// <summary>
    /// Holds a unity-container and makes it available as a singleton.
    /// </summary>
    public static class Container
    {
        /// <summary>
        /// Gets the unity-container instance.
        /// </summary>
        public static IUnityContainer Instance { get; private set; }

        /// <summary>
        /// Initialiez the container with the provided unity-container/
        /// </summary>
        /// <param name="unityContainer">The unity-container to be made available as a singleton.</param>
        public static void Initialize(IUnityContainer unityContainer)
        {
            if (Instance == null)
            {
                Instance = unityContainer;
            }
        }
    }
}
